#pragma comment(linker, "/STACK:10000000")
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
#include <cstdio>
#include <cassert>
#include <string>
#include <cstring>
#define ldb long double
#define LL long long
#define fi first
#define se second
#define fill(a, c) memset(a, c, sizeof(a))
#define sqr(a) ((a) * (a))
#define nextLine() {int c = 0; while((c = getchar()) != 10 && c != EOF);}
#define getBit(mask, k) (((mask) / pw[k]) % pw[1])
#define setBit(mask, k, l) (((mask) / pw[k + 1] * pw[1] + (l)) * pw[k] + ((mask) % pw[k]))
#define debug(a) cerr << #a << " = " << a << " ";
#define debugl(a) cerr << #a << " = " << a << "\n";
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define ff first
#define ss second 
const ldb LDINF = 9128739847123.00;
const ldb eps = 1e-9;
const int inf = 1 << 28;
const ldb pi = fabsl(atan2l(0.0, -1.0));
using namespace std;

int n;
ldb L, S, R;

void load()
{	
	cin >> n >> L >> S >> R;
	L /= 100.0;
	S /= 100.0;
	R /= 100.0;
}
map <pair <int, int>, ldb> dp;
const int MAXS = 500;
//ldb dp[1 << 18][MAXS];
//char calced[1 << 18][MAXS];
int usd;
/*
ldb expected(int n, int can_l, int can_r)
{
	if (n == 0) return 0;
	if (n == 2)
	{
		if (can_l && can_r)
		{
			if (L > S + R + eps)
			{
				
			}
		}	
	}
}

ldb f(int n, int p)
{
	if (n <= 2)
		return expected(n, p, 0);
	if (dp[n][p] != -1) return dp[n][p];
	dp[n][p] = L * (f(n - 1, 1) + 1) + S * (expected(1, p, 1) + 1 + f(n - 2, 1))
	+ R * (expected(2, p, 1) + 1 + f(n - 3, 1));
	return dp[n][p];
}
*/

inline bool painted(int mask, int i)
{
	if (i < 0 || i >= n) return true;
	return mask & (1 << i);
}

inline ldb get_prob(int mask, int posi)
{
	ldb res = 0.;
	if (!painted(mask, posi - 1))
		res += L;
	if (!painted(mask, posi))
		res += S;
	if (!painted(mask, posi + 1))
		res += R;
	return res;
}

ldb f(int , int);

void upd(ldb & res, int mask, int h, int posi)
{
	if (posi == -1) return;
	ldb we = 0;
	ldb notwe = 0;
	if (painted(mask, posi - 1))
		we += L;
	else notwe += L * (f(mask | (1 << (posi - 1)), h + 1));
	if (painted(mask, posi))
		we += S;
	else notwe += S * (f(mask | (1 << posi), h + 1));
	if (painted(mask, posi + 1))
		we += R;
	else notwe += R * (f(mask | (1 << (posi + 1)), h + 1));
	res = min(res, we * f(mask, h + 1) + notwe);
}

ldb f(int mask, int h)
{
//	if (h >= MAXS) return h;
	if (mask == (1 << n) - 1) return h;
	if (dp.find(mp(mask, h)) != dp.end()) return dp[mp(mask, h)];
//	if (calced[mask][h] == usd) return dp[mask][h];
//	calced[mask][h] = usd;
	ldb res = 1e42;
	ldb we, notwe;
/*	for (up = 0; up < n; up++)
	{
		if (!(mask & (1 << up)) | !(mask & (1 << (up + 1))) | !(mask & (1 << (up + 2)))) break;
	}
	up = min(up + 3, n);
	*/
	for (int i = 0; i < n; i++)
	{
		
	//	if (get_prob(mask, i) < eps) continue;
		we = 0;
		notwe = 0;
		if (painted(mask, i - 1))
			we += L;
		else notwe += L * (f(mask | (1 << (i - 1)), h + 1));
		if (painted(mask, i))
			we += S;
		else notwe += S * (f(mask | (1 << i), h + 1));
		if (painted(mask, i + 1))
			we += R;
		else notwe += R * (f(mask | (1 << (i + 1)), h + 1));
		if (res > (notwe + 1.0) / (1.0 - we) + eps)
		{
			res =  (notwe + 1.0) / (1.0 - we);
			//if (res < 1e42 - eps) break;
		}
		if (painted(mask, i) && !painted(mask, i + 1) && !painted(mask, i + 2)) break;
		
	    
		
	/*	if (cur_prob < get_prob(mask, i) - eps)
		{
			cur_prob2 = cur_prob1;
			cur_prob1 = cur_prob;
			posk = posj;
			posj = posi;
			cur_prob = get_prob(mask, i);
			posi = i;
		}
		else if (cur_prob1 < get_prob(mask, i) - eps)
		{
			cur_prob2 = cur_prob1;
			posk = posj;
			cur_prob1 = get_prob(mask, i);
			posj = i;
		}
		else if (cur_prob2 < get_prob(mask, i) - eps)
		{
			cur_prob2 = get_prob(mask, i);
			posk = i;
		}*/
		
		
		
	}
//	upd(res, mask, h, posi);
//	upd(res, mask, h, posj);
//	upd(res, mask, h, posk);
	dp[mp(mask,h)] = res;
	return res;
}


void solve()
{
	dp.clear();
//	usd++;
	cout << setprecision(10) << fixed << f(0, 0) << "\n";
}

#define file "d"
int main()
{
	#ifndef ONLINE_JUDGE
		freopen(file".in", "rt", stdin);
		freopen(file".out", "wt", stdout);
	#endif
	int T;
	cin >> T;
	for (int i = 0; i < T; i++)
	{
		load();
		cerr << i << "\n";
		solve();
	}
	return 0;
}
